<div class="header_menu">
    <div class="container">
        <div class="header-nav clearfix">
            <?php echo $this->partial('shop/layout/headerMenu'); ?>
        </div>
    </div>
</div>
</div>
<div class="container breadcrumbs">
    <a href="<?php echo $this->url('shop'); ?>"><?php echo $this->translate('首页'); ?></a>
    <span class="sep">/</span><span><?php echo $this->translate('换货'); ?></span>
</div>
<?php
$form = $this->form;
$form->prepare();

$form->setAttributes(['class' => 'form-horizontal']);

$form->get('returnInfo')->setAttributes(['placeholder' => $this->translate('申请说明')]);
?>
<div class="container">
    <div class="uc-full-box">
        <div class="row">
            <div class="span4">
                <?php echo $this->partial('shop/partial/home/leftMenu'); ?>
            </div>
            <div class="span16">
                <div class="xm-line-box uc-box uc-order-detail-box">
                    <div class="box-hd">
                        <h3 class="title">
                            <?php echo $this->translate('换货'); ?>
                            &nbsp;&nbsp;
                            <a href="<?php echo $this->url('shop-service', ['id' => $this->orderGoods->getOrderGoodsId()]); ?>" class="btn btn-default btn-a-url"><?php echo $this->translate('返回'); ?></a>
                        </h3>
                    </div>

                    <div class="box-bd">
                        <?php echo $this->partial('shop/message'); ?>

                        <div class="uc-order-list-box">
                            <ul class="uc-order-detail-list">
                                <li class="uc-order-detail-item">
                                    <table class="order-detail-table">
                                        <tbody>
                                        <tr>
                                            <td class="column-detail column-l">
                                                <ul class="order-goods-list">
                                                    <li class="first">
                                                        <a href="<?php echo $this->url('shop-goods', ['id' => $this->orderGoods->getGoodsId()]); ?>" target="_blank">
                                                            <img src="<?php echo $this->shopHelper()->baseGoodsImagePath($this->orderGoods->getGoodsImage()); ?>" class="goods-thumb">
                                                        </a>
                                                        <a class="goods-name" href="<?php echo $this->url('shop-goods', ['id' => $this->orderGoods->getGoodsId()]); ?>" target="_blank"><?php echo $this->escapeHtml($this->orderGoods->getGoodsName()); ?></a>
                                                        <span class="goods-price"><?php echo $this->shopHelper()->orderCurrency($this->orderGoods->getGoodsPrice(), $this->orderInfo->getCurrencySymbol()); ?> x <?php echo $this->orderGoods->getBuyNum(); ?> = <strong><?php echo $this->shopHelper()->orderCurrency($this->orderGoods->getGoodsAmount(), $this->orderInfo->getCurrencySymbol()); ?></strong></span>
                                                        <span style="display: block;"><?php echo $this->escapeHtml($this->orderGoods->getInSpecGoodsStr()); ?></span>
                                                    </li>
                                                </ul>
                                            </td>
                                        </tr>
                                        </tbody>
                                    </table>
                                </li>
                            </ul>
                        </div>

                        <?php echo $this->form()->openTag($form); ?>
                        <div class="control-group">
                            <label class="control-label"><?php echo $this->translate('换货原因'); ?>：</label>
                            <div class="controls">
                                <?php echo $this->formElement($form->get('returnReason')->setAttributes(['class' => 'span4'])); ?>
                                <?php echo $this->formElementErrors($form->get('returnReason'), ['class'=>'error-message']); ?>
                            </div>
                        </div>
                        <div class="control-group">
                            <label class="control-label"><?php echo $this->translate('申请说明'); ?>：</label>
                            <div class="controls">
                                <?php echo $this->formElement($form->get('returnInfo')->setAttributes(['class' => 'span6'])); ?>
                                <?php echo $this->formElementErrors($form->get('returnInfo'), ['class'=>'error-message']); ?>
                            </div>
                        </div>
                        <div class="offset3">
                            <button class="btn btn-primary" type="submit"><?php echo $this->translate('提交'); ?></button>
                        </div>
                        <?php echo $this->form()->closeTag(); ?>
                    </div>

                </div>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
    $(document).ready(function() {
        $("#<?php echo $form->getName(); ?>").validate({
            rules: {
                returnReason: {
                    required: true
                },
                returnInfo: {
                    required: true
                },
            },
            messages: {
                returnReason: {
                    required: "<?php echo $this->translate('请选择换货原因!'); ?>"
                },
                returnInfo: {
                    required: "<?php echo $this->translate('申请说明不能为空!'); ?>"
                },
            }
        });
    });
</script>